package com.example.userconsumer.feign;

import com.example.userconsumer.config.FeignConfig;
import com.example.userconsumer.hystrix.UserFeignHystrix;
import com.myshop.b2b.commonmodule.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author likaiping
 * @createTime 2024/7/2 19:13
 */
@Component
@FeignClient(value = "user-provider",fallback = UserFeignHystrix.class,
        configuration = FeignConfig.class)
public interface UserFeign {
    @GetMapping("/login")
    User login(@RequestParam(value = "uname") String uname);

    @GetMapping("/register")
    int register(@RequestParam(value = "upassword")String upassword,
                         @RequestParam(value = "uname")String uname,
                         @RequestParam(value = "usex") String usex);
}
